Integrand size = 12, antiderivative size = 107 \[ \int (a+b \sec (c+d x))^4 \, dx=a^4 x+\frac {2 a b \left (2 a^2+b^2\right ) \text {arctanh}(\sin (c+d x))}{d}+\frac {b^2 \left (17 a^2+2 b^2\right ) \tan (c+d x)}{3 d}+\frac {4 a b^3 \sec (c+d x) \tan (c+d x)}{3 d}+\frac {b^2 (a+b \sec (c+d x))^2 \tan (c+d x)}{3 d} \]
a^4*x+2*a*b*(2*a^2+b^2)*arctanh(sin(d*x+c))/d+1/3*b^2*(17*a^2+2*b^2)*tan(d *x+c)/d+4/3*a*b^3*sec(d*x+c)*tan(d*x+c)/d+1/3*b^2*(a+b*sec(d*x+c))^2*tan(d *x+c)/d
Time = 0.23 (sec) , antiderivative size = 77, normalized size of antiderivative = 0.72 \[ \int (a+b \sec (c+d x))^4 \, dx=\frac {3 a^4 d x+6 a b \left (2 a^2+b^2\right ) \text {arctanh}(\sin (c+d x))+3 b^2 \left (6 a^2+b^2+2 a b \sec (c+d x)\right ) \tan (c+d x)+b^4 \tan ^3(c+d x)}{3 d} \]
(3*a^4*d*x + 6*a*b*(2*a^2 + b^2)*ArcTanh[Sin[c + d*x]] + 3*b^2*(6*a^2 + b^ 2 + 2*a*b*Sec[c + d*x])*Tan[c + d*x] + b^4*Tan[c + d*x]^3)/(3*d)
Time = 0.42 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.07, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.417, Rules used = {3042, 4269, 3042, 4536, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (a+b \sec (c+d x))^4 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^4dx\) |
\(\Big \downarrow \) 4269 |
\(\displaystyle \frac {1}{3} \int (a+b \sec (c+d x)) \left (3 a^3+8 b^2 \sec ^2(c+d x) a+b \left (9 a^2+2 b^2\right ) \sec (c+d x)\right )dx+\frac {b^2 \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{3} \int \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right ) \left (3 a^3+8 b^2 \csc \left (c+d x+\frac {\pi }{2}\right )^2 a+b \left (9 a^2+2 b^2\right ) \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx+\frac {b^2 \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 4536 |
\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \int \left (6 a^4+12 b \left (2 a^2+b^2\right ) \sec (c+d x) a+2 b^2 \left (17 a^2+2 b^2\right ) \sec ^2(c+d x)\right )dx+\frac {4 a b^3 \tan (c+d x) \sec (c+d x)}{d}\right )+\frac {b^2 \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \left (6 a^4 x+\frac {12 a b \left (2 a^2+b^2\right ) \text {arctanh}(\sin (c+d x))}{d}+\frac {2 b^2 \left (17 a^2+2 b^2\right ) \tan (c+d x)}{d}\right )+\frac {4 a b^3 \tan (c+d x) \sec (c+d x)}{d}\right )+\frac {b^2 \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
(b^2*(a + b*Sec[c + d*x])^2*Tan[c + d*x])/(3*d) + ((4*a*b^3*Sec[c + d*x]*T an[c + d*x])/d + (6*a^4*x + (12*a*b*(2*a^2 + b^2)*ArcTanh[Sin[c + d*x]])/d + (2*b^2*(17*a^2 + 2*b^2)*Tan[c + d*x])/d)/2)/3
3.5.79.3.1 Defintions of rubi rules used
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Simp[(-b^2)*C ot[c + d*x]*((a + b*Csc[c + d*x])^(n - 2)/(d*(n - 1))), x] + Simp[1/(n - 1) Int[(a + b*Csc[c + d*x])^(n - 3)*Simp[a^3*(n - 1) + (b*(b^2*(n - 2) + 3* a^2*(n - 1)))*Csc[c + d*x] + (a*b^2*(3*n - 4))*Csc[c + d*x]^2, x], x], x] / ; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0] && GtQ[n, 2] && IntegerQ[2*n]
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. ))*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[(-b)*C*Csc[e + f*x]*(Cot[e + f*x]/(2*f)), x] + Simp[1/2 Int[Simp[2*A*a + (2*B*a + b*(2* A + C))*Csc[e + f*x] + 2*(a*C + B*b)*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a , b, e, f, A, B, C}, x]
Time = 1.23 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.02
method | result | size |
derivativedivides | \(\frac {a^{4} \left (d x +c \right )+4 a^{3} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+6 \tan \left (d x +c \right ) a^{2} b^{2}+4 a \,b^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-b^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}\) | \(109\) |
default | \(\frac {a^{4} \left (d x +c \right )+4 a^{3} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+6 \tan \left (d x +c \right ) a^{2} b^{2}+4 a \,b^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-b^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}\) | \(109\) |
parts | \(a^{4} x -\frac {b^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}+\frac {4 a^{3} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {6 a^{2} b^{2} \tan \left (d x +c \right )}{d}+\frac {2 a \,b^{3} \sec \left (d x +c \right ) \tan \left (d x +c \right )}{d}+\frac {2 a \,b^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) | \(117\) |
risch | \(a^{4} x -\frac {4 i b^{2} \left (3 a b \,{\mathrm e}^{5 i \left (d x +c \right )}-9 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-18 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-3 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-3 a b \,{\mathrm e}^{i \left (d x +c \right )}-9 a^{2}-b^{2}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}-\frac {4 a^{3} b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}-\frac {2 a \,b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {4 a^{3} b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}+\frac {2 a \,b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}\) | \(196\) |
parallelrisch | \(\frac {-36 \left (a^{2}+\frac {b^{2}}{2}\right ) \left (\cos \left (d x +c \right )+\frac {\cos \left (3 d x +3 c \right )}{3}\right ) a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+36 \left (a^{2}+\frac {b^{2}}{2}\right ) \left (\cos \left (d x +c \right )+\frac {\cos \left (3 d x +3 c \right )}{3}\right ) a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+3 a^{4} x d \cos \left (3 d x +3 c \right )+2 \left (9 a^{2} b^{2}+b^{4}\right ) \sin \left (3 d x +3 c \right )+12 a \,b^{3} \sin \left (2 d x +2 c \right )+9 a^{4} x d \cos \left (d x +c \right )+6 \left (3 a^{2} b^{2}+b^{4}\right ) \sin \left (d x +c \right )}{3 d \left (\cos \left (3 d x +3 c \right )+3 \cos \left (d x +c \right )\right )}\) | \(200\) |
norman | \(\frac {a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}-a^{4} x +3 a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-3 a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\frac {4 b^{2} \left (18 a^{2}+b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 d}-\frac {2 b^{2} \left (6 a^{2}-2 a b +b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-\frac {2 b^{2} \left (6 a^{2}+2 a b +b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}-\frac {2 a b \left (2 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}+\frac {2 a b \left (2 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}\) | \(221\) |
1/d*(a^4*(d*x+c)+4*a^3*b*ln(sec(d*x+c)+tan(d*x+c))+6*tan(d*x+c)*a^2*b^2+4* a*b^3*(1/2*sec(d*x+c)*tan(d*x+c)+1/2*ln(sec(d*x+c)+tan(d*x+c)))-b^4*(-2/3- 1/3*sec(d*x+c)^2)*tan(d*x+c))
Time = 0.27 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.29 \[ \int (a+b \sec (c+d x))^4 \, dx=\frac {3 \, a^{4} d x \cos \left (d x + c\right )^{3} + 3 \, {\left (2 \, a^{3} b + a b^{3}\right )} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (2 \, a^{3} b + a b^{3}\right )} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + {\left (6 \, a b^{3} \cos \left (d x + c\right ) + b^{4} + 2 \, {\left (9 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{3 \, d \cos \left (d x + c\right )^{3}} \]
1/3*(3*a^4*d*x*cos(d*x + c)^3 + 3*(2*a^3*b + a*b^3)*cos(d*x + c)^3*log(sin (d*x + c) + 1) - 3*(2*a^3*b + a*b^3)*cos(d*x + c)^3*log(-sin(d*x + c) + 1) + (6*a*b^3*cos(d*x + c) + b^4 + 2*(9*a^2*b^2 + b^4)*cos(d*x + c)^2)*sin(d *x + c))/(d*cos(d*x + c)^3)
\[ \int (a+b \sec (c+d x))^4 \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right )^{4}\, dx \]
Time = 0.21 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.13 \[ \int (a+b \sec (c+d x))^4 \, dx=a^{4} x + \frac {{\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} b^{4}}{3 \, d} - \frac {a b^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{d} + \frac {4 \, a^{3} b \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right )}{d} + \frac {6 \, a^{2} b^{2} \tan \left (d x + c\right )}{d} \]
a^4*x + 1/3*(tan(d*x + c)^3 + 3*tan(d*x + c))*b^4/d - a*b^3*(2*sin(d*x + c )/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1))/d + 4*a^3*b*log(sec(d*x + c) + tan(d*x + c))/d + 6*a^2*b^2*tan(d*x + c)/d
Leaf count of result is larger than twice the leaf count of optimal. 221 vs. \(2 (101) = 202\).
Time = 0.33 (sec) , antiderivative size = 221, normalized size of antiderivative = 2.07 \[ \int (a+b \sec (c+d x))^4 \, dx=\frac {3 \, {\left (d x + c\right )} a^{4} + 6 \, {\left (2 \, a^{3} b + a b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 6 \, {\left (2 \, a^{3} b + a b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (18 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 36 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 18 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3}}}{3 \, d} \]
1/3*(3*(d*x + c)*a^4 + 6*(2*a^3*b + a*b^3)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 6*(2*a^3*b + a*b^3)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(18*a^2*b ^2*tan(1/2*d*x + 1/2*c)^5 - 6*a*b^3*tan(1/2*d*x + 1/2*c)^5 + 3*b^4*tan(1/2 *d*x + 1/2*c)^5 - 36*a^2*b^2*tan(1/2*d*x + 1/2*c)^3 - 2*b^4*tan(1/2*d*x + 1/2*c)^3 + 18*a^2*b^2*tan(1/2*d*x + 1/2*c) + 6*a*b^3*tan(1/2*d*x + 1/2*c) + 3*b^4*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^3)/d
Time = 13.76 (sec) , antiderivative size = 185, normalized size of antiderivative = 1.73 \[ \int (a+b \sec (c+d x))^4 \, dx=\frac {2\,a^4\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,b^4\,\sin \left (c+d\,x\right )}{3\,d\,\cos \left (c+d\,x\right )}+\frac {b^4\,\sin \left (c+d\,x\right )}{3\,d\,{\cos \left (c+d\,x\right )}^3}+\frac {4\,a\,b^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {8\,a^3\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,a\,b^3\,\sin \left (c+d\,x\right )}{d\,{\cos \left (c+d\,x\right )}^2}+\frac {6\,a^2\,b^2\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )} \]
(2*a^4*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (2*b^4*sin(c + d*x ))/(3*d*cos(c + d*x)) + (b^4*sin(c + d*x))/(3*d*cos(c + d*x)^3) + (4*a*b^3 *atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (8*a^3*b*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (2*a*b^3*sin(c + d*x))/(d*cos(c + d*x) ^2) + (6*a^2*b^2*sin(c + d*x))/(d*cos(c + d*x))